#ifndef INCLUDE_Wave2_H
#define INCLUDE_Wave2_H

#include <iostream>
#include <time.h>
#include "GameState.h"
#include "Map.h"
#include "Character.h"
#include "EnemyTypeB.h"
#include "Bullet.h"
#include "FileHandling.h"
#include "Life.h"


using namespace SGE;
using namespace std;
class Wave2 : public GameState
{
public:
	Wave2(GameContext& gc);
	void FireBullets(float deltaTime);
	void SpawnEnemy(float deltaTime);
	void CheckEnemyBulletCollision(int collisiontype,float deltaTime);
	void CheckPlayerBulletCollision(int collisiontype,float deltaTime);
	void CheckPlayerEnemyCollision(int collisiontype,float deltaTime);

	void InitializeWaveEnemy(char* enemytype);

	virtual ~Wave2();
	virtual void Load();
	virtual void Unload();
	virtual NextState Update (float deltaTime);
	virtual void Render();



private:
	Map mmap;
	Character mCharacter;
	
	static const int kMaxBullets = 20;
	static const int kMaxEnemies = 7;
	static const int kMaxExplosions = 100;
	/*EnemyTypeA* mEnemyArr;*/
	/*EnemyTypeB* mEnemy2Arr;
	EnemyTypeC* mEnemy3Arr;*/
	int mEnemyNum;
	EnemyTypeB mEnemyB[kMaxEnemies];
	Bullet mGun1[kMaxBullets];


	SGE_Emitter mExplosion[kMaxExplosions];
	SGE_Sound mFireSound;
	SGE_Sound mExplosionSound;


	SGE_Font mFont;
	SGE_Cursor mCursor;
	SGE_Button mStartButton1;
	SGE_Button mQuitButton;

	Life mLife[3];
	SGE_Sprite mExitScreen;


	SVector2 mPos;
	SVector2 mVel;
	string mEnemyTypeCheck;
	float mDelay;
	float mSpawnDelay;
	int mBulletIndex;
	int mEnemyIndex;

	/*int mEnemyTypeAlimit;*/
	int mEnemyTypeBlimit;
	int mEnemyTypeClimit;
	int mExplosionIndex;
	int mWaveCount;
	int enemycheck;
	int mRandomSpawnCount;
	int mLifecheck;

	char* mEnemyType;


	bool IsGameOver;
	bool isquit;

	FILE*fp;
	char* mfilename;
	char* mfilename1;
	FileHandling FileHandle;
};
#endif
